/**
 * 
 */
package com.dfhc.util;

import javax.servlet.http.HttpServletRequest;

import com.dfhc.ISystemConstant;

/**
 * @author 龙色波
 * Jsp工具类
 */
public class JspHelper {
	/**
     * 从request中获得排序关键字
     * @param request
     * @return
     */
    public static String getOrderStr(HttpServletRequest request) {
        StringBuilder orderStr = null;
        if(request.getParameter(ISystemConstant.SORT) != null && request.getParameter(ISystemConstant.SORT).trim().length() > 0){
        	orderStr = new StringBuilder(request.getParameter(ISystemConstant.SORT).trim());
        	orderStr.append(request.getParameter(ISystemConstant.DIR) != null ? " " + request.getParameter(ISystemConstant.DIR).trim() : "");
        }
        return orderStr == null ? null : orderStr.toString();
    }
}
